﻿using sx_windows.dial;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sx_windows
{ 
    public partial class MainForm : DialContract.View
    {
        public void SetSxUserText(string user)
        {
            this.sxUserEdit.Text = user;
        }

        public string GetSxUserText()
        {
            return this.sxUserEdit.Text;
        }

        public void SetSxPasswordText(string password)
        {
            this.sxPasswordEdit.Text = password;
        }

        public string GetSxPasswordText()
        {
            return this.sxPasswordEdit.Text;
        }

        private void pppoeDialBtn_Click(object sender, EventArgs e)
        {
            dialPresenter.PppoeBtnClick();
        }

        private void routerDialBtn_Click(object sender, EventArgs e)
        {
            dialPresenter.RouterBtnClick();
        }

        public void SetNeedSendHeart(bool b)
        {
            this.sendHeartCheckBox.Checked = b;
        }

        public bool GetNeedSendHeart()
        {
            return this.sendHeartCheckBox.Checked;
        }
        private void getPasswordLInk_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            DialogResult result = MessageBox.Show(this, "此功能将会获取动态密码，使用静态密码的同学勿用！", "注意", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (result == DialogResult.Yes)
            {
                dialPresenter.GetPasswordBtnClick();
            }
        }
    }
}
